package liuyang.bigeventserver.modules.catetory.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.sql.BatchUpdateException;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * 
 * @TableName category
 */
@TableName(value ="category")
@Data
public class Category implements Serializable {

    public interface Add {}
    public interface Update {}

    /**
     * ID
     */
    @TableId(type = IdType.AUTO)
    @NotNull(groups = {Update.class})// 202403021806 实测 貌似主键上不能用@NotEmpty
    private Long id;

    /**
     * 分类名称
     */
    @NotEmpty(groups = {Add.class, Update.class})// 202403021553 实测 @NotNull也可拦截不传递该字段，区别在于二者返回的提示。
    private String categoryName;

    /**
     * 分类别名
     */
    @NotEmpty(groups = {Add.class, Update.class})
    private String categoryAlias;

    /**
     * 创建人ID
     */
    private Long createUser;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}